import java.util.concurrent.CountDownLatch;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.DelayQueue;
import java.util.concurrent.Delayed;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.Semaphore;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;

public class demo_02 {

    public static void main(String[] args) {
        MaoPao();
    }

    static void MaoPao(){
        int[] z = {3,41,6,2,8,2};
        for (int i = 0; i < z.length; i++) {
            for (int j = 0; j < z.length - i-1; j++) {
                if(z[j]>z[j+1]){
                    int temp = z[j];
                    z[j] = z[j+1];
                    z[j+1] = temp;
                }
            }
        }
        for (int i = 0; i < z.length; i++) {
            System.out.println(z[i]+",");
        }
    }
    static void XuanZe(){
        int[] z = {3,41,6,2,8,2};
        for (int i = 0; i < z.length; i++) {
            for (int j = i+1; j < z.length; j++) {
                int ii = z[i];
                int jj = z[j];
                if(ii<jj){
                    int temp = ii;
                    z[i] = jj;
                    z[j] = temp;
                }
            }
        }
        for (int i = 0; i < z.length; i++) {
            System.out.println(z[i]+",");
        }
    }

    static void testThreadPool(){
        new ThreadPoolExecutor(5,10,3,TimeUnit.MINUTES,new LinkedBlockingDeque<>(),yh);
        new DelayQueue(2).add(new Delayed() {
            
        })

        ReentrantLock r = new ReentrantLock();
        r.newCondition().await();
        Semaphore d = new Semaphore(5);
        new CyclicBarrier();
        CountDownLatch ddd = new CountDownLatch(5);
        ThreadLocal h = new ThreadLocal<String>();
        h.set("");
        h.remove();
        Thread.currentThread()
        IdentityHashMap
    }
}